<?php

namespace app\admin\model;

use app\common\constants\MenuConstant;
use app\common\model\TimeModel;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;

class InsuranceReprule extends TimeModel
{
    protected function getOptions(): array
    {
        return [
            'deleteTime' => 'delete_time',
        ];
    }

    protected $type = [
        'content_rep_rule' => 'json',
    ];


    /**
     * @throws ModelNotFoundException
     * @throws DbException
     * @throws DataNotFoundException
     */
    public static function getList(): array
    {
        $field = '*';
        $list = self::field($field)->where([
            ['status', '<', 2],
        ])->select()->toArray();

        return $list;
    }

    public static $p_keys = [
        '1' => 'company',
        '2' => 'insurer',
        '3' => 'carno',
        '4' => 'idcard',
        '5' => 'mobile',
        '6' => 'num',
        '7' => 'cost',
        '8' => 'vv_tax',
        '9' => 'is_car_damage',
        '10' => 'start_at',
        '11' => 'end_at',
        '12' => 'create_at',
        '13' => 'agent',
        '14' => 'third_party_cost',
        '15' => 'car_type',
        '16' => 'is_driver',
        '17' => 'is_passenger',
        '18' => 'sale_type',
    ];

    public static $p_titles = [
        '1' => '保险公司',
        '2' => '投保人',
        '3' => '车牌号',
        '4' => '身份证',
        '5' => '手机号',
        '6' => '保单号',
        '7' => '保额',
        '8' => '车船税',
        '9' => '车损',
        '10' => '起保日期',
        '11' => '止保日期',
        '12' => '出单日期',
        '13' => '代理人',
        '14' => '第三者保额',
        '15' => '汽车类型',
        '16' => '司机险',
        '17' => '乘客险',
        '18' => '渠道',
    ];

}